package net.wenku8.reader.view.user

import androidx.compose.foundation.layout.Column
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.lifecycle.viewmodel.compose.viewModel
import net.wenku8.reader.ui.lite.LiteLine
import net.wenku8.reader.ui.lite.LitePanel
import net.wenku8.reader.ui.lite.LiteText


@Composable
fun AccountDetail() {
    val accountDetailViewModel = viewModel<AccountDetailViewModel>()
    LaunchedEffect(Unit) {
        accountDetailViewModel.initData()
    }
    LitePanel(
        hostState = accountDetailViewModel.hostState,
        title = "账户详情",
        backNav = true
    ) {
        Column{
            LiteLine {
                LiteText(text = "用户名："+accountDetailViewModel.userInfo.uname)
            }
            LiteLine {
                LiteText(text = "昵称："+accountDetailViewModel.userInfo.nickname)
            }
            LiteLine {
                LiteText(text = "积分："+accountDetailViewModel.userInfo.score)
            }
            LiteLine {
                LiteText(text = "经验值："+accountDetailViewModel.userInfo.experience)
            }
            LiteLine {
                LiteText(text = "等级："+accountDetailViewModel.userInfo.rank)
            }
        }
    }

}
